#! /bin/sh

cd /root/scaffolding-python

source venv/bin/activate

git reset --hard HEAD

git pull

rm -rf .env

cp .env.bak .env

ps -ef | grep scaffolding-python | grep -v grep | awk '{print $2}' | while IFS= read -r line; do
    kill -9 $line
done

nohup uvicorn app:app --reload --host 0.0.0.0 --port 10013 &

deactivate
